<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 15:22:10
 * @LastEditTime: 2023-11-12 13:52:22
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 
 */

namespace App\Models;


use App\Traits\CommonUserTrait;

class ProRepairreason extends BaseModel
    {
    use CommonUserTrait;
    public $table = "basedata_pro_repairreason";
    protected $guarded = [];
    public $timestamps = true;
    public function details()
        {
        return $this->hasMany(ProRepairreasonDetails::class, "repairreason_id");
        }
    public function status()
        {
        return $this->belongsTo(Dic::class, "status_id", "key")->where(function ($q)
            {
            $q->where("code", 'table_status');
            });
        }
    }
